package FactoryMethod.cashier;

/**
 * @author duanzhizhou
 * @date 2024/9/26
 */
public abstract class CashDecorator implements Cashier {
    
    protected final Cashier component;
    
    public CashDecorator(Cashier cashier) {
        this.component = cashier;
    }
    
    @Override
    public double check(double price, int cnt) {
        if (component != null) {
            return component.check(price, cnt);
        }
        return 0;
    }
}
